﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Prism.Games.GalEngine.Scripts.FunctionModel;

namespace Prism.Games.GalEngine.Scripts.Data.SceneElements
{
    [Serializable]
    public class EffectSound : Prism.Games.GalEngine.Scripts.FunctionModel.SceneVisualElement, IAudio, IItemIncrementalMarkableHost
    {
        public EffectSound(IItemIncrementalMarkable host)
        {
            this.Host = host;
        }

        private Uri source;
        public Uri Source
        {
            get { return this.source; }
            set
            {
                if (value != this.source)
                {
                    this.source = value;
                    this.OnPropertyChanged("Source");
                }
            }
        }

        private Uri partUri;
        public Uri PartUri
        {
            get { return this.partUri; }
            set
            {
                if (value != this.partUri)
                {
                    this.partUri = value;
                    this.OnPropertyChanged("PartUri");
                }
            }
        }

        private bool sourceIsPartUri;
        public bool SourceIsPartUri
        {
            get { return this.sourceIsPartUri; }
            set
            {
                if (value != this.sourceIsPartUri)
                {
                    this.sourceIsPartUri = value;
                    this.OnPropertyChanged("SourceIsPartUri");
                }
            }
        }

        public bool IsCached
        {
            get;
            set;
        }

        [field: NonSerialized]
        private System.IO.Stream cacheStream;

        public System.IO.Stream CacheStream
        {
            get { return cacheStream; }
            set { cacheStream = value; }
        }

        public IItemIncrementalMarkable Host
        {
            get;
            set;
        }
    }
}
